package goutil

import "sync"

var RGroup sync.WaitGroup

func CreateRoutine(f func(args ...interface{}) interface{}, args ...interface{}) chan interface{} {
	RGroup.Add(1)
	c := make(chan interface{}, 1)
	go func() {
		c <- f(args...)
		RGroup.Done()
	}()
	return c
}
